﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;

namespace DiplomaWeb.Models.Student
{
    public class StudentListViewModel
    {
        public IEnumerable<SelectListItem> StudentList { get; set; }
        
        public void ToViewModel(IEnumerable<Diploma.Models.Student> getStudents)
        {
            StudentList = getStudents.Select(r => new SelectListItem
                                                      {
                                                          Text = r.FullName,
                                                          Value = r.UserId.ToString()
                                                      });
        }
    }
}